package com.siyoumi.modules.admin.web;

import com.siyoumi.component.http.XHttpContext;
import com.siyoumi.controller.AdminApiController;
import com.siyoumi.modules.admin.service.AdminService;
import com.siyoumi.util.XReturn;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/xadmin/sys/logout")
public class ApiAdminLogout
        extends AdminApiController {
    @GetMapping()
    public XReturn logout() {
        String token = XHttpContext.getToken();
        return AdminService.getBean().logout(token);
    }
}
